package com.langfeiyes.pattern.interpret.demo1;

//乘法
public class DivExpression implements Expression{

    private Expression num1Expression;   //第一个除数
    private Expression num2Expression;   //第二个除数

    public DivExpression(Expression num1Expression, Expression num2Expression){
        this.num1Expression = num1Expression;
        this.num2Expression = num2Expression;
    }
    @Override
    public int interpret() {
        return num1Expression.interpret() / num2Expression.interpret();
    }
    @Override
    public String toString() {
        return "/";
    }
}
